﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NLBS.Web
{ 
   public class AjaxUrlFormatsProvider:UrlFormatsProvider
    {
        public override string RssUrl()
        {
            throw new NotImplementedException();
        }

        public override string ArticleCategoryRssUrl(int catID)
        {
            throw new NotImplementedException();
        }

        public override string CommentRssUrl()
        {
            throw new NotImplementedException();
        }

        public override string ArticleCategoryUrl(int catID)
        {

            return string.Format("NLBSArticle.getCategoryContent('{0}')", catID);
        }

        public override string ArticleSelectedUrl()
        {
            throw new NotImplementedException();
        }

        public override string ArticleModeUrl(string mode)
        {
            return string.Format("NLBSArticle.getModeContent('{0}')", mode);
        }

        public override string ArticleDateUrl(string date)
        {
            return string.Format("NLBSArticle.getDayContent('{0}')", date);
        }

        public override string ArticleConent(int articleID)
        {
            return string.Format("NLBSArticle.getContentByID('{0}')", articleID);
        }

        public override string Comment()
        {
            return "getCommonList('commentlist')";
        }
       
        public override string GuestBook()
        {
            return "getCommonList('guestbooklist')";
        }

        public override string Login()
        {
            return "login()";
        }

        public override string ArticleAction(string act, int articleID)
        {
            throw new NotImplementedException();
        }

        public override string CommentEditUrl(int commentID, int logID)
        {
            return string.Format("commentEdit('{0}','{1}')",commentID,logID);
        }
       
        public override string CommentDeleteUrl(int commentID, int logID)
        {
            return string.Format("NLBSComment.deleteComment('{0}','{1}')", commentID, logID);
        }

        public override string GuestBookEditUrl(int gbookID)
        {
            throw new NotImplementedException();
        }

        public override string GuestBookDeleteUrl(int gbookID)
        {
            return string.Format("NLBSGuestBook.deleteGuestBook('{0}')", gbookID);
        }

        public override string UserList()
        {
            return "getCommonList('userlist')";
        }

        public override string UserDetail(int id)
        {
            return string.Format("NLBSUser.getUserDetail('{0}')", id);
        }

        public override string UserDelete(int id)
        {
            return string.Format("NLBSUser.deleteUser('{0}')", id);
        }

        public override string Visitors()
        {
            return "getCommonList('visitors')";
        }

        public override string Index()
        {
            return "NLBSArticle.getDefaultContent()";
        }

        public override string SelectedArticle()
        {
            return "NLBSArticle.getSelectedContent()";
        }

        public override string UserArticle(int id)
        {
            return string.Format("NLBSArticle.getUserContent('{0}')", id);
        }

        public override string UserComment(int id)
        {
            return string.Format("NLBSComment.getUserComment('{0}')", id);
        }

        public override string CatComment(int id)
        {
            return string.Format("NLBSComment.getCatComment('{0}')", id);
        }

        public override string[] ArticleComment(int logID)
        {
            List<string> list = new List<string>();
            list.Add(string.Format("NLBSArticle.getContentByID('{0}')", logID));
            list.Add("#commentbox");
            return list.ToArray();
        }

        public override string[] SingleComment(int logID,int commentID)
        {
            List<string> list = new List<string>();
            list.Add(string.Format("NLBSArticle.getContentByID('{0}')", logID));
            list.Add(string.Format("#comment{0}", commentID));
            return list.ToArray();
        }

        public override string TrackBack()
        {
            return "getCommonList('trackbacklist')";
        }

        public override string ArticleTrackBack(int logID)
        {
            return string.Format("NLBSTrackBack.getContentByID('{0}')", logID);
        }

        public override string TrackBackDeleteUrl(int tbID)
        {
            return string.Format("NLBSTrackBack.deleteTrackBack('{0}')", tbID);
        }
    }
}
